<?php

class RegTeacherController extends Controller
{
	public function actionListTeacher($id)
	{
		$this->layout='//layouts/blank';
		$model=new UserAccount('search');
		$model->unsetAttributes();  // clear any default values
		$model->user_type="teacher";
		if(isset($_GET['UserAccount']))
			$model->attributes=$_GET['UserAccount'];
		if ($id==1)
			$this->render('listTeacher',array(
				'model'=>$model,
				'id'=>$id,
		));
		else{
			$this->render('listTeacher2',array(
					'model'=>$model,
					'id'=>$id,
			));
		}
	}
	public function actionGetTeacher($id)
	{
		$techer=UserAccount::model()->findByPk($id);
		if ($techer){
		$data=array(
				'teacherID'=>$techer->user_id,
				'name'=>$techer->name." ".$techer->surname,
		);
		}
		echo json_encode($data);
	}
	// Uncomment the following methods and override them if needed
	/*
	public function filters()
	{
		// return the filter configuration for this controller, e.g.:
		return array(
			'inlineFilterName',
			array(
				'class'=>'path.to.FilterClass',
				'propertyName'=>'propertyValue',
			),
		);
	}

	public function actions()
	{
		// return external action classes, e.g.:
		return array(
			'action1'=>'path.to.ActionClass',
			'action2'=>array(
				'class'=>'path.to.AnotherActionClass',
				'propertyName'=>'propertyValue',
			),
		);
	}
	*/
}